//
//  HomeOwnViewModel.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/3.
//

import Foundation
class StatisticsTagViewModel : BaseViewModel {
    @Published var items = [TagBean]()
    @Published var status = ""

    func getData(_ isRefresh: Bool = false) {
        requestList(isRefresh: isRefresh) {
            let list = try await BackupsManager.shared.getDelegateConfig()?.getTagList() ?? []
            try check(!isRefresh || !list.isEmpty, "暂无标签数据")
            return list
        } suc: { list in
            self.items.append(contentsOf: list)
            self.status = ""
        } fail: {
            self.status = $0.message
        }
    }
}
